-
Notifications
You must be signed in to change notification settings - Fork 660
refactor(rome_js_anaylze): introduce StaticValue enum for checking value of the JSX attributes or JS expressions #4342
Conversation
✅ Deploy Preview for docs-rometools ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
@MichaReiser This PR is based on your comments in #4073, so I would appreciate if you could review. |
CHANGELOG.md
Outdated
|
||
#### Other changes | ||
|
||
- Refactor common logic for checking value of the JSX attributes or JS expressions [#4073](https://github.com/rome/tools/pull/4073) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to document internal changes that don't affect the users. From this PR, the only change for users is the fact that we fixed a case inside the useNumericLiterals
rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the differences in CHANGELOG.md.
self.text() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document this API and add a doctest, like we do for other public APIs exposed by this crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added doctests for StaticValue and QuotedString.
This reverts commit 64735f4.
Summary
This PR introduces common logic for checking expression values based on #4073 and discussion. This is useful when implementing some aria rules that checks value of the JSX attributes.
After merge in this PR, I will refactor much more in the current codebases using this methods.
Test Plan
I need to keep the current tests passed. I updated
useNumericLiterals/invalid.js.snap
because the previous code didn't handle empty template string correctly.Changelog
Documentation